hipchat.rb expects the notify option to be a boolean

Dominik Sander 10 lat temu
rodzic
commit
9fd3ca7bf1
2 zmienionych plików z 3 dodań i 3 usunięć
  1. 1 1
      app/models/agents/hipchat_agent.rb
  2. 2 2
      spec/models/agents/hipchat_agent_spec.rb

+ 1 - 1
app/models/agents/hipchat_agent.rb

@@ -43,7 +43,7 @@ module Agents
43 43
       client = HipChat::Client.new(interpolated[:auth_token] || credential('hipchat_auth_token'))
44 44
       incoming_events.each do |event|
45 45
         mo = interpolated(event)
46
-        client[mo[:room_name]].send(mo[:username], mo[:message], :notify => boolify(mo[:notify]) ? 1 : 0, :color => mo[:color])
46
+        client[mo[:room_name]].send(mo[:username], mo[:message], :notify => boolify(mo[:notify]), :color => mo[:color])
47 47
       end
48 48
     end
49 49
   end

+ 2 - 2
spec/models/agents/hipchat_agent_spec.rb

@@ -7,7 +7,7 @@ describe Agents::HipchatAgent do
7 7
                       'room_name' => 'test',
8 8
                       'username' => "{{username}}",
9 9
                       'message' => "{{message}}",
10
-                      'notify' => false,
10
+                      'notify' => 'false',
11 11
                       'color' => 'yellow',
12 12
                     }
13 13
 
@@ -53,7 +53,7 @@ describe Agents::HipchatAgent do
53 53
   describe "#receive" do
54 54
     it "send a message to the hipchat" do
55 55
       any_instance_of(HipChat::Room) do |obj|
56
-        mock(obj).send(@event.payload[:username], @event.payload[:message], {:notify => 0, :color => 'yellow'})
56
+        mock(obj).send(@event.payload[:username], @event.payload[:message], {:notify => false, :color => 'yellow'})
57 57
       end
58 58
       @checker.receive([@event])
59 59
     end